//@author A0092201X 
#include "stdafx.h"
#include "CppUnitTest.h"

using namespace Microsoft::VisualStudio::CppUnitTestFramework;

namespace TestCommand
{		
	TEST_CLASS(TaskUnitTests)
	{
	public:
		TEST_METHOD(FloatingTaskWithNoIndexConstructor)
		{
			std::string inputText = "[F]\tThis is a Floating Task\t-\t-\tJurong Point";
			Task task(inputText);

			//time compare - the usual '==' operator will not work
			double differenceInStartDateTime;
			double differenceInEndDateTime;
			differenceInStartDateTime = difftime(task.getStartDateTime(), NO_TIME);
			differenceInEndDateTime = difftime(task.getEndDateTime(), NO_TIME);

			Assert::AreEqual(NO_INDEX, task.getIndex());		
			Assert::AreEqual((std::string)"[F]", task.getCode());
			Assert::AreEqual((std::string)"This is a Floating Task", task.getDescription());
			Assert::AreEqual((double) 0, differenceInStartDateTime);
			Assert::AreEqual((double) 0, differenceInEndDateTime);
			Assert::AreEqual((std::string)"Jurong Point", task.getLocation());
			Assert::AreEqual((std::string)"[F]\tThis is a Floating Task\t-\t-\tJurong Point", task.prepareLine());
		}

		TEST_METHOD(DeadlineTaskWithIndexConstructor)
		{ 
			//setting up time input
			tm endDateTimetm;
			endDateTimetm.tm_year = 114;
			endDateTimetm.tm_mon = 2;
			endDateTimetm.tm_mday = 14;
			endDateTimetm.tm_hour = 23;
			endDateTimetm.tm_min = 59;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[D]\tThis is a Deadline Task\t-\t14/03/14 2359\t-";
			Task task(2, inputText);

			Assert::AreEqual(2, task.getIndex());
			Assert::AreEqual((std::string)"[D]", task.getCode());
			Assert::AreEqual((std::string)"This is a Deadline Task", task.getDescription());
			Assert::AreEqual(NO_TIME, (long) task.getStartDateTime());
			Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
			Assert::AreEqual((std::string)""  , task.getLocation());
			Assert::AreEqual((std::string)"[D]\tThis is a Deadline Task\t-\t14/03/14 2359\t-", task.prepareLine());
		}

		TEST_METHOD(TimedTaskWithNoIndexConstructor)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 114;
			startDateTimetm.tm_mon = 12 - 1;
			startDateTimetm.tm_mday = 24;
			startDateTimetm.tm_hour = 20;
			startDateTimetm.tm_min = 0;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 114;
			endDateTimetm.tm_mon = 12 - 1;
			endDateTimetm.tm_mday = 24;
			endDateTimetm.tm_hour = 23;
			endDateTimetm.tm_min = 59;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\tThis is a Timed Task\t24/12/14 2000\t24/12/14 2359\t-";
			Task task(inputText);
			
			Assert::AreEqual(NO_INDEX, task.getIndex());
			Assert::AreEqual((std::string)"[T]", task.getCode());
			Assert::AreEqual((std::string)"This is a Timed Task", task.getDescription());
			Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
			Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
			Assert::AreEqual((std::string)""  , task.getLocation());
			Assert::AreEqual((std::string)"[T]\tThis is a Timed Task\t24/12/14 2000\t24/12/14 2359\t-", task.prepareLine());
		}

		TEST_METHOD(PartialTimedTaskWithIndexConstructor)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 114;
			startDateTimetm.tm_mon = 11;
			startDateTimetm.tm_mday = 24;
			startDateTimetm.tm_hour = 20;
			startDateTimetm.tm_min = 0;
			startDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			
			std::string inputText = "[P]\tThis is a Partial Timed Task\t24/12/14 2000\t-\tSchool";
			Task task(999, inputText);

			Assert::AreEqual(999, task.getIndex());
			Assert::AreEqual((std::string)"[P]", task.getCode());
			Assert::AreEqual((std::string)"This is a Partial Timed Task", task.getDescription());
			Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
			Assert::AreEqual((long) NO_TIME, (long) task.getEndDateTime());
			Assert::AreEqual((std::string) "School"  , task.getLocation());
			Assert::AreEqual((std::string)"[P]\tThis is a Partial Timed Task\t24/12/14 2000\t-\tSchool", task.prepareLine());
		}

		TEST_METHOD(Timed28NonLeapYearFeb)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 15;
			startDateTimetm.tm_mon = 2 - 1;
			startDateTimetm.tm_mday = 28;
			startDateTimetm.tm_hour = 0;
			startDateTimetm.tm_min = 0;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 15;
			endDateTimetm.tm_mon = 2 - 1;
			endDateTimetm.tm_mday = 28;
			endDateTimetm.tm_hour = 23;
			endDateTimetm.tm_min = 59;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\tThis is a Timed Task with 28, non-leap year Feb\t28/02/15 0000\t28/02/15 2359\t-";
			
			try {
				Task task(123, inputText);
				Assert::AreEqual(123, task.getIndex());	
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"This is a Timed Task with 28, non-leap year Feb", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\tThis is a Timed Task with 28, non-leap year Feb\t28/02/15 0000\t28/02/15 2359\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = "";
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		
		}

		TEST_METHOD(PartialTimed29NonLeapYearFeb)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 15;
			startDateTimetm.tm_mon = 2 - 1;
			startDateTimetm.tm_mday = 29;
			startDateTimetm.tm_hour = 23;
			startDateTimetm.tm_min = 59;
			startDateTimetm.tm_sec = 59;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			
			std::string inputText = "[P]\tThis is a Partial Timed Task with 29, non-leap year Feb\t29/02/15 2359\t-\t-";
			
			try {
				Task task(2000, inputText);
				Assert::AreEqual(2000, task.getIndex());
				Assert::AreEqual((std::string)"[P]", task.getCode());
				Assert::AreEqual((std::string)"This is a Partial Timed Task with 29, non-leap year Feb", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) NO_TIME, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[P]\tThis is a Partial Timed Task with 29, non-leap year Feb\t29/02/15 2359\t-\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_MDAYOUTOFRANGENONLEAPFEB;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(Deadline29LeapYearFeb)
		{ 
			//setting up time input
			tm deadlineDateTimetm;
			deadlineDateTimetm.tm_year = 100 + 16;
			deadlineDateTimetm.tm_mon = 2 - 1;
			deadlineDateTimetm.tm_mday = 29;
			deadlineDateTimetm.tm_hour = 12;
			deadlineDateTimetm.tm_min = 22;
			deadlineDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t deadlineDateTime;
			deadlineDateTime = mktime(&deadlineDateTimetm);
			
			std::string inputText = "[D]\tThis is a Deadline with 29, leap year Feb\t-\t29/02/16 1222\t-";
			
			try {
				Task task(10000, inputText);
				Assert::AreEqual(10000, task.getIndex());	
				Assert::AreEqual((std::string)"[D]", task.getCode());
				Assert::AreEqual((std::string)"This is a Deadline with 29, leap year Feb", task.getDescription());
				Assert::AreEqual((long) NO_TIME, (long) task.getStartDateTime());
				Assert::AreEqual((long) deadlineDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[D]\tThis is a Deadline with 29, leap year Feb\t-\t29/02/16 1222\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = "";
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		
		}

		TEST_METHOD(Timed30LeapYearFeb)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 16;
			startDateTimetm.tm_mon = 2 - 1;
			startDateTimetm.tm_mday = 30;
			startDateTimetm.tm_hour = 14;
			startDateTimetm.tm_min = 44;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 16;
			endDateTimetm.tm_mon = 2 - 1;
			endDateTimetm.tm_mday = 30;
			endDateTimetm.tm_hour = 16;
			endDateTimetm.tm_min = 46;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\tThis is a Timed Task with 30, leap year Feb\t30/02/16 1444\t30/02/16 1646\t-";
			
			try {
				Task task(100000, inputText);
				Assert::AreEqual(100000, task.getIndex());
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"This is a Timed Task with 30, leap year Feb", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\tThis is a Timed Task with 30, leap year Feb\t30/02/16 1444\t30/02/16 1646\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_MDAYOUTOFRANGELEAPFEB;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(PartialTimed30In30DayMonth)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 14;
			startDateTimetm.tm_mon = 6 - 1;
			startDateTimetm.tm_mday = 30;
			startDateTimetm.tm_hour = 1;
			startDateTimetm.tm_min = 10;
			startDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			
			std::string inputText = "[P]\tThis is a Partial Timed Task with 30, 30-day month\t30/06/14 0110\t-\t-";
			
			try {
				Task task(1000000, inputText);
				Assert::AreEqual(1000000, task.getIndex());
				Assert::AreEqual((std::string)"[P]", task.getCode());
				Assert::AreEqual((std::string)"This is a Partial Timed Task with 30, 30-day month", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) NO_TIME, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[P]\tThis is a Partial Timed Task with 30, 30-day month\t30/06/14 0110\t-\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = "";
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(Deadline31In30DayMonth)
		{ 
			//setting up time input
			tm deadlineDateTimetm;
			deadlineDateTimetm.tm_year = 100 + 14;
			deadlineDateTimetm.tm_mon = 9 - 1;
			deadlineDateTimetm.tm_mday = 31;
			deadlineDateTimetm.tm_hour = 4;
			deadlineDateTimetm.tm_min = 44;
			deadlineDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t deadlineDateTime;
			deadlineDateTime = mktime(&deadlineDateTimetm);
			
			std::string inputText = "[D]\tThis is a Deadline with 31, 30-day month\t-\t31/09/14 0444\t-";
			
			try {
				Task task(1000000, inputText);
				Assert::AreEqual(10000000, task.getIndex());	
				Assert::AreEqual((std::string)"[D]", task.getCode());
				Assert::AreEqual((std::string)"This is a Deadline with 31, 30-day month", task.getDescription());
				Assert::AreEqual((long) NO_TIME, (long) task.getStartDateTime());
				Assert::AreEqual((long) deadlineDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[D]\tThis is a Deadline with 31, 30-day month\t-\t31/09/14 0444\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_MDAYOUTOFRANGE30DAYMONTH;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		
		}

		TEST_METHOD(Timed31In31DayMonth)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 14;
			startDateTimetm.tm_mon = 10 - 1;
			startDateTimetm.tm_mday = 31;
			startDateTimetm.tm_hour = 3;
			startDateTimetm.tm_min = 33;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 14;
			endDateTimetm.tm_mon = 10 - 1;
			endDateTimetm.tm_mday = 31;
			endDateTimetm.tm_hour = 13;
			endDateTimetm.tm_min = 33;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\tThis is a Timed Task with 31, 31-day month\t31/10/14 0333\t31/10/14 1333\t-";
			
			try {
				Task task(100000000, inputText);
				Assert::AreEqual(100000000, task.getIndex());
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"This is a Timed Task with 31, 31-day month", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\tThis is a Timed Task with 31, 31-day month\t31/10/14 0333\t31/10/14 1333\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = "";
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(PartialTimed32In31DayMonth)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 20;
			startDateTimetm.tm_mon = 8 - 1;
			startDateTimetm.tm_mday = 32;
			startDateTimetm.tm_hour = 17;
			startDateTimetm.tm_min = 32;
			startDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			
			std::string inputText = "[P]\tThis is a Partial Timed Task with 32, 31-day month\t32/08/20 1732\t-\t-";
			
			try {
				Task task(25, inputText);
				Assert::AreEqual(25, task.getIndex());
				Assert::AreEqual((std::string)"[P]", task.getCode());
				Assert::AreEqual((std::string)"This is a Partial Timed Task with 32, 31-day month", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) NO_TIME, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[P]\tThis is a Partial Timed Task with 32, 31-day month\t32/08/20 1732\t-\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_MDAYOUTOFRANGE31DAYMONTH;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(DeadlineHour24)
		{ 
			//setting up time input
			tm deadlineDateTimetm;
			deadlineDateTimetm.tm_year = 100 + 14;
			deadlineDateTimetm.tm_mon = 5 - 1;
			deadlineDateTimetm.tm_mday = 15;
			deadlineDateTimetm.tm_hour = 24;
			deadlineDateTimetm.tm_min = 44;
			deadlineDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t deadlineDateTime;
			deadlineDateTime = mktime(&deadlineDateTimetm);
			
			std::string inputText = "[D]\tThis is a Deadline with hour 24\t-\t15/05/14 2444\t-";
			
			try {
				Task task(72, inputText);
				Assert::AreEqual(72, task.getIndex());	
				Assert::AreEqual((std::string)"[D]", task.getCode());
				Assert::AreEqual((std::string)"This is a Deadline with hour 24", task.getDescription());
				Assert::AreEqual((long) NO_TIME, (long) task.getStartDateTime());
				Assert::AreEqual((long) deadlineDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[D]\tThis is a Deadline with hour 24\t-\t15/05/14 2444\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_HOUROUTOFRANGE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		
		}

		TEST_METHOD(TimedMin60)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 19;
			startDateTimetm.tm_mon = 11 - 1;
			startDateTimetm.tm_mday = 20;
			startDateTimetm.tm_hour = 12;
			startDateTimetm.tm_min = 60;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 19;
			endDateTimetm.tm_mon = 11 - 1;
			endDateTimetm.tm_mday = 20;
			endDateTimetm.tm_hour = 14;
			endDateTimetm.tm_min = 0;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\tThis is a Timed Task with min 60\t20/11/14 1260\t20/11/14 1400\t-";
			
			try {
				Task task(84, inputText);
				Assert::AreEqual(84, task.getIndex());
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"This is a Timed Task with min 60", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\tThis is a Timed Task with min 60\t20/11/14 1260\t20/11/14 1400\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_MINOUTOFRANGE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(InvalidStringFormat)
		{ 
			std::string inputText = "[F]\ttesting invalid string floating task\t-\t-";
			
			try {
				Task task(33, inputText);
				Assert::AreEqual(33, task.getIndex());
				Assert::AreEqual((std::string)"[F]", task.getCode());
				Assert::AreEqual((std::string)"testing invalid string floating task", task.getDescription());
				Assert::AreEqual((long) NO_TIME, (long) task.getStartDateTime());
				Assert::AreEqual((long) NO_TIME, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[F]\ttesting invalid string floating task\t-\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INVALIDSTRINGFORMAT;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(InvalidTypeCode)
		{ 
			std::string inputText = "[A]\ttesting invalid task type code\t-\t-\t-";
			
			try {
				Task task(48, inputText);
				Assert::AreEqual(48, task.getIndex());
				Assert::AreEqual((std::string)"[A]", task.getCode());
				Assert::AreEqual((std::string)"testing invalid task type code", task.getDescription());
				Assert::AreEqual((long) NO_TIME, (long) task.getStartDateTime());
				Assert::AreEqual((long) NO_TIME, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[A]\ttesting invalid task type code\t-\t-\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INVALIDTYPECODE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(IncorrectEmptyAttributeSymbol)
		{ 
			std::string inputText = "[F]\ttesting incorrect empty attribute symbol\t\t\t";
			
			try {
				Task task(101, inputText);
				Assert::AreEqual(101, task.getIndex());
				Assert::AreEqual((std::string)"[F]", task.getCode());
				Assert::AreEqual((std::string)"testing incorrect empty attribute symbol", task.getDescription());
				Assert::AreEqual((long) NO_TIME, (long) task.getStartDateTime());
				Assert::AreEqual((long) NO_TIME, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[F]\ttesting incorrect empty attribute symbol\t\t\t", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INCORRECTEMPTYATTRIBUTESYMBOL;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(NoDescription)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 12;
			startDateTimetm.tm_mon = 2 - 1;
			startDateTimetm.tm_mday = 22;
			startDateTimetm.tm_hour = 8;
			startDateTimetm.tm_min = 0;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 12;
			endDateTimetm.tm_mon = 2 - 1;
			endDateTimetm.tm_mday = 22;
			endDateTimetm.tm_hour = 9;
			endDateTimetm.tm_min = 0;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\t-\t22/02/12 0800\t22/02/12 0900\tBali Best Western Kuta Beach";
			
			try {
				Task task(55, inputText);
				Assert::AreEqual(55, task.getIndex());
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) "Bali Best Western Kuta Beach"  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\t-\t22/02/12 0800\t22/02/12 0900\tBali Best Western Kuta Beach", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_NODESCRIPTION;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(InvalidDateTime)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 12;
			startDateTimetm.tm_mon = 2 - 1;
			startDateTimetm.tm_mday = 22;
			startDateTimetm.tm_hour = 8;
			startDateTimetm.tm_min = 0;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 12;
			endDateTimetm.tm_mon = 2 - 1;
			endDateTimetm.tm_mday = 22;
			endDateTimetm.tm_hour = 9;
			endDateTimetm.tm_min = 0;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\tWas the happiest and most meaningful day of life, but it is just a shred of memory now... strangers again.\t22/02/2012 08:00am\t22/02/2012 09:00am\tBali Best Western Kuta Beach";
			
			try {
				Task task(55, inputText);
				Assert::AreEqual(55, task.getIndex());
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"Was the happiest and most meaningful day of life, but it is just a shred of memory now... strangers again.", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) "Bali Best Western Kuta Beach"  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\t-\t22/02/12 0800\t22/02/12 0900\tBali Best Western Kuta Beach", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INVALIDDATETIME;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		}

		TEST_METHOD(InvalidDate1)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 12;
			startDateTimetm.tm_mon = 2 - 1;
			startDateTimetm.tm_mday = 22;
			startDateTimetm.tm_hour = 8;
			startDateTimetm.tm_min = 0;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 12;
			endDateTimetm.tm_mon = 2 - 1;
			endDateTimetm.tm_mday = 22;
			endDateTimetm.tm_hour = 9;
			endDateTimetm.tm_min = 0;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\tWas the happiest and most meaningful day of life, but it is just a shred of memory now... strangers again.\t22/O2/12 0800\t22/02/12 0900\tBali Best Western Kuta Beach";
			
			try {
				Task task(55, inputText);
				Assert::AreEqual(55, task.getIndex());
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"Was the happiest and most meaningful day of life, but it is just a shred of memory now... strangers again.", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) "Bali Best Western Kuta Beach"  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\t-\t22/02/12 0800\t22/02/12 0900\tBali Best Western Kuta Beach", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INVALIDDATE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		}

		TEST_METHOD(InvalidDate2)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 12;
			startDateTimetm.tm_mon = 2 - 1;
			startDateTimetm.tm_mday = 22;
			startDateTimetm.tm_hour = 8;
			startDateTimetm.tm_min = 0;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 12;
			endDateTimetm.tm_mon = 2 - 1;
			endDateTimetm.tm_mday = 22;
			endDateTimetm.tm_hour = 9;
			endDateTimetm.tm_min = 0;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\tWas the happiest and most meaningful day of life, but it is just a shred of memory now... strangers again.\t22/02/12 0800\t22/02/l2 0900\tBali Best Western Kuta Beach";
			
			try {
				Task task(55, inputText);
				Assert::AreEqual(55, task.getIndex());
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"Was the happiest and most meaningful day of life, but it is just a shred of memory now... strangers again.", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) "Bali Best Western Kuta Beach"  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\t-\t22/02/12 0800\t22/02/12 0900\tBali Best Western Kuta Beach", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INVALIDDATE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		}

		TEST_METHOD(InvalidTime1)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 12;
			startDateTimetm.tm_mon = 2 - 1;
			startDateTimetm.tm_mday = 22;
			startDateTimetm.tm_hour = 8;
			startDateTimetm.tm_min = 0;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 12;
			endDateTimetm.tm_mon = 2 - 1;
			endDateTimetm.tm_mday = 22;
			endDateTimetm.tm_hour = 9;
			endDateTimetm.tm_min = 0;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\tWas the happiest and most meaningful day of life, but it is just a shred of memory now... strangers again.\t22/02/12 3:00\t22/02/12 0400\tBali Best Western Kuta Beach";
			
			try {
				Task task(55, inputText);
				Assert::AreEqual(55, task.getIndex());
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"Was the happiest and most meaningful day of life, but it is just a shred of memory now... strangers again.", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) "Bali Best Western Kuta Beach"  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\t-\t22/02/12 0800\t22/02/12 0900\tBali Best Western Kuta Beach", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INVALIDTIME;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		}

		TEST_METHOD(InvalidTime2)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 12;
			startDateTimetm.tm_mon = 2 - 1;
			startDateTimetm.tm_mday = 22;
			startDateTimetm.tm_hour = 8;
			startDateTimetm.tm_min = 0;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 12;
			endDateTimetm.tm_mon = 2 - 1;
			endDateTimetm.tm_mday = 22;
			endDateTimetm.tm_hour = 9;
			endDateTimetm.tm_min = 0;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\tWas the happiest and most meaningful day of life, but it is just a shred of memory now... strangers again.\t22/02/12 0300\t22/02/12 4:00\tBali Best Western Kuta Beach";
			
			try {
				Task task(55, inputText);
				Assert::AreEqual(55, task.getIndex());
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"Was the happiest and most meaningful day of life, but it is just a shred of memory now... strangers again.", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) "Bali Best Western Kuta Beach"  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\t-\t22/02/12 0800\t22/02/12 0900\tBali Best Western Kuta Beach", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INVALIDTIME;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		}

		TEST_METHOD(IncorrectTypeCodeTimedWithStartNoEnd)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 13;
			startDateTimetm.tm_mon = 4 - 1;
			startDateTimetm.tm_mday = 24;
			startDateTimetm.tm_hour = 14;
			startDateTimetm.tm_min = 44;
			startDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			
			std::string inputText = "[T]\ttesting incorrect type code - timed with start no end\t24/04/13 1444\t-\t-";
			
			try {
				Task task(63, inputText);
				Assert::AreEqual(63, task.getIndex());
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"testing incorrect type code - timed with start no end", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) NO_TIME, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\ttesting incorrect type code - timed with start no end\t24/04/13 1444\t-\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INCORRECTTYPECODE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(IncorrectTypeCodeTimedNoStartWithEndWithLocation)
		{ 
			//setting up time input
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 14;
			endDateTimetm.tm_mon = 7 - 1;
			endDateTimetm.tm_mday = 19;
			endDateTimetm.tm_hour = 19;
			endDateTimetm.tm_min = 49;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[T]\ttesting incorrect type code - timed no start with end\t-\t24/04/13 1444\ttest location";
			
			try {
				Task task(68, inputText);
				Assert::AreEqual(68, task.getIndex());
				Assert::AreEqual((std::string)"[T]", task.getCode());
				Assert::AreEqual((std::string)"testing incorrect type code - timed no start with end", task.getDescription());
				Assert::AreEqual((long) NO_TIME, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) "test location"  , task.getLocation());
				Assert::AreEqual((std::string)"[T]\ttesting incorrect type code - timed no start with end\t-\t24/04/13 1444\ttest location", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INCORRECTTYPECODE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(IncorrectTypeCodePartialTimedWithStartAndEndWithoutLocation)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 14;
			startDateTimetm.tm_mon = 8 - 1;
			startDateTimetm.tm_mday = 18;
			startDateTimetm.tm_hour = 18;
			startDateTimetm.tm_min = 18;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 14;
			endDateTimetm.tm_mon = 8 - 1;
			endDateTimetm.tm_mday = 18;
			endDateTimetm.tm_hour = 22;
			endDateTimetm.tm_min = 18;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[P]\ttesting incorrect type code - partial-timed with start and end\t18/08/14 1818\t18/08/14 2218\t-";
			
			try {
				Task task(7, inputText);
				Assert::AreEqual(7, task.getIndex());
				Assert::AreEqual((std::string)"[P]", task.getCode());
				Assert::AreEqual((std::string)"testing incorrect type code - partial-timed with start and end", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[P]\ttesting incorrect type code - partial-timed with start and end\t18/08/14 1818\t18/08/14 2218\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INCORRECTTYPECODE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(IncorrectTypeCodePartialTimedNoStartWithEndWithLocation)
		{ 
			//setting up time input
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 17;
			endDateTimetm.tm_mon = 7 - 1;
			endDateTimetm.tm_mday = 17;
			endDateTimetm.tm_hour = 07;
			endDateTimetm.tm_min = 17;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[P]\ttesting incorrect type code - partial-timed no start with end\t-\t17/07/17 0717\t-";
			
			try {
				Task task(77, inputText);
				Assert::AreEqual(77, task.getIndex());
				Assert::AreEqual((std::string)"[P]", task.getCode());
				Assert::AreEqual((std::string)"testing incorrect type code - partial-timed no start with end", task.getDescription());
				Assert::AreEqual((long) NO_TIME, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[P]\ttesting incorrect type code - partial-timed no start with end\t-\t17/07/17 0717\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INCORRECTTYPECODE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(IncorrectTypeCodeDeadlineWithStartNoEndWithoutLocation)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 20;
			startDateTimetm.tm_mon = 8 - 1;
			startDateTimetm.tm_mday = 27;
			startDateTimetm.tm_hour = 17;
			startDateTimetm.tm_min = 32;
			startDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			
			std::string inputText = "[D]\ttesting incorrect type code - deadline with start no end\t27/08/20 1732\t-\t-";
			
			try {
				Task task(97, inputText);
				Assert::AreEqual(97, task.getIndex());
				Assert::AreEqual((std::string)"[D]", task.getCode());
				Assert::AreEqual((std::string)"testing incorrect type code - deadline with start no end", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) NO_TIME, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) ""  , task.getLocation());
				Assert::AreEqual((std::string)"[D]\ttesting incorrect type code - deadline with start no end\t27/08/20 1732\t-\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INCORRECTTYPECODE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(IncorrectTypeCodeDeadlineWithStartAndEndWithLocation)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 100 + 15;
			startDateTimetm.tm_mon = 3 - 1;
			startDateTimetm.tm_mday = 13;
			startDateTimetm.tm_hour = 13;
			startDateTimetm.tm_min = 33;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 100 + 15;
			endDateTimetm.tm_mon = 3 - 1;
			endDateTimetm.tm_mday = 13;
			endDateTimetm.tm_hour = 15;
			endDateTimetm.tm_min = 35;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[D]\ttesting incorrect type code - deadline with start and end\t13/03/15 1333\t13/03/15 1535\tblah blah location";
			
			try {
				Task task(39, inputText);
				Assert::AreEqual(39, task.getIndex());
				Assert::AreEqual((std::string)"[D]", task.getCode());
				Assert::AreEqual((std::string)"testing incorrect type code - deadline with start and end", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) "blah blah location"  , task.getLocation());
				Assert::AreEqual((std::string)"[D]\ttesting incorrect type code - deadline with start and end\t13/03/15 1333\t13/03/15 1535\tblah blah location", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INCORRECTTYPECODE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}

		}

		TEST_METHOD(IncorrectTypeCodeFloatingWithStartNoEnd)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 114;
			startDateTimetm.tm_mon = 11;
			startDateTimetm.tm_mday = 24;
			startDateTimetm.tm_hour = 20;
			startDateTimetm.tm_min = 0;
			startDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			
			std::string inputText = "[F]\ttesting incorrect type code - floating with start no end\t24/12/14 2000\t-\tSchool";
			
			try {
				Task task(23, inputText);
				Assert::AreEqual(23, task.getIndex());
				Assert::AreEqual((std::string)"[F]", task.getCode());
				Assert::AreEqual((std::string)"testing incorrect type code - floating with start no end", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) NO_TIME, (long) task.getEndDateTime());
				Assert::AreEqual((std::string) "School"  , task.getLocation());
				Assert::AreEqual((std::string)"[F]\ttesting incorrect type code - floating with start no end\t24/12/14 2000\t-\tSchool", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INCORRECTTYPECODE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		}

		TEST_METHOD(IncorrectTypeCodeFloatingNoStartWithEnd)
		{ 
			//setting up time input
			tm endDateTimetm;
			endDateTimetm.tm_year = 114;
			endDateTimetm.tm_mon = 2;
			endDateTimetm.tm_mday = 14;
			endDateTimetm.tm_hour = 23;
			endDateTimetm.tm_min = 59;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[F]\ttesting incorrect type code - floating no start with end\t-\t14/03/14 2359\t-";
			
			try {
				Task task(39, inputText);
				Assert::AreEqual(39, task.getIndex());
				Assert::AreEqual((std::string)"[F]", task.getCode());
				Assert::AreEqual((std::string)"testing incorrect type code - floating no start with end", task.getDescription());
				Assert::AreEqual(NO_TIME, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string)""  , task.getLocation());
				Assert::AreEqual((std::string)"[F]\ttesting incorrect type code - floating no start with end\t-\t14/03/14 2359\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INCORRECTTYPECODE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		}

		TEST_METHOD(IncorrectTypeCodeFloatingWithStartAndEnd)
		{ 
			//setting up time input
			tm startDateTimetm;
			startDateTimetm.tm_year = 114;
			startDateTimetm.tm_mon = 11;
			startDateTimetm.tm_mday = 24;
			startDateTimetm.tm_hour = 20;
			startDateTimetm.tm_min = 0;
			startDateTimetm.tm_sec = 0;
			tm endDateTimetm;
			endDateTimetm.tm_year = 114;
			endDateTimetm.tm_mon = 11;
			endDateTimetm.tm_mday = 24;
			endDateTimetm.tm_hour = 23;
			endDateTimetm.tm_min = 59;
			endDateTimetm.tm_sec = 0;

			//casting of type tm to type time_t to string
			time_t startDateTime;
			startDateTime = mktime(&startDateTimetm);
			time_t endDateTime;
			endDateTime = mktime(&endDateTimetm);
			
			std::string inputText = "[F]\ttesting incorrect type code - floating with start and end\t24/12/14 2000\t24/12/14 2359\t-";
			
			try {
				Task task(15, inputText);
				Assert::AreEqual(15, task.getIndex());
				Assert::AreEqual((std::string)"[F]", task.getCode());
				Assert::AreEqual((std::string)"testing incorrect type code - floating with start and end", task.getDescription());
				Assert::AreEqual((long) startDateTime, (long) task.getStartDateTime());
				Assert::AreEqual((long) endDateTime, (long) task.getEndDateTime());
				Assert::AreEqual((std::string)""  , task.getLocation());
				Assert::AreEqual((std::string)"[F]\ttesting incorrect type code - floating with start and end\t24/12/14 2000\t24/12/14 2359\t-", task.prepareLine());
			} catch(std::exception& exception) {
				std::string expectedExceptionString = TASKERROR_INCORRECTTYPECODE;
				std::string exceptionString = exception.what();
				Assert::AreEqual(expectedExceptionString, exceptionString);
			}
		
		}

	};
}